package org.statewalker.dict;

public interface IToken {

    /**
     * Returns the internal key associated with this token when it was created.
     * The internal key is not changed while iterations.
     * 
     * @return the internal key
     */
    String getInternalKey();

    /**
     * the key used to identify transitions between states. This key could be
     * changed by validators to change the flow of control. To get the "real"
     * key associated with this token while its creation the method
     * {@link #getInternalKey()} should be used.
     * 
     * @return the key used to identify transitions between states
     */
    String getKey();

    /**
     * Returns <code>true</code> if this token corresponds to a closing "tag".
     * 
     * @return <code>true</code> if this token corresponds to a closing "tag"
     */
    boolean isClose();

    /**
     * Returns <code>true</code> if this token corresponds to an opening "tag".
     * 
     * @return <code>true</code> if this token corresponds to an opening "tag"
     */
    boolean isOpen();

    /**
     * Sets a new control key associated with this token.
     * 
     * @param key the key used to manage the flow of control
     */
    void setKey(String key);

}